package mmoon.mmoonstory.blocks;

import mmoon.mmoonstory.interfaces.HasModel;
import mmoon.mmoonstory.interfaces.InitBlock;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

import java.util.Random;

public class BlockGreenPrint extends Block implements InitBlock, HasModel {

    public static final String ObjID = "green_print";

    public BlockGreenPrint() {
        super(Material.GLASS);
        this.setSoundType(SoundType.GLASS);
        this.setHardness(0.5F);
        this.setLightLevel(1F);
        this.setLightOpacity(1);
        this.init(ObjID);
    }

    @Override
    public int quantityDropped(IBlockState state, int fortune, Random random) {
        return 0;
    }

    @Override
    public boolean isFullCube(IBlockState state) {
        /* 是不完整方块，不会造成窒息伤害 */
        return false;
    }

    @Override
    public EnumBlockRenderType getRenderType(IBlockState state) {
        /* 不会渲染此类方块 */
        return EnumBlockRenderType.INVISIBLE;
    }

    @Override
    public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) {
        /* 没有碰撞箱 */
        return Block.NULL_AABB;
    }

    @Override
    public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player) {
        return true;
    }
}
